package singleton;

public class Main {

    public static void main(String[] args) {
        SingleInstance instance = SingleInstance.getInstance("hello world");
        instance.print();
        System.out.println("instance:" + instance);

        SingleInstance instanceHi = SingleInstance.getInstance("hi world");
        instanceHi.print();
        System.out.println("instance:" + instanceHi);

        instanceHi.setName("hi world");
        instanceHi.print();
        System.out.println("instance:" + instanceHi);

        instance.print();
        System.out.println("instance:" + instance);

    }
}
